package com.dxy.hms.mapper;

import com.dxy.hms.model.entity.RoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 角色菜单关联表 Mapper 接口
 * </p>
 *
 * @author dxy
 * @since 2024-09-24
 */
@Mapper
public interface RoleMenuMapper {

    void delByRoleId(Long roleId);

    void delByMenuId(String menuId);

    void delByRoleIdAndNotInMenuIds(@Param("roleId")Long roleId, @Param("menuIdList")List<String> menuIdList);

    void addOrIgnore(RoleMenu entity);

    void addOrIgnoreBatch(List<RoleMenu> entityList);

    List<RoleMenu> getByRoleId(Long roleId);

    Set<String> getMenuIdByUserId(Long userId);
}
